//
//  ViewController.m
//  RulerSlider
//
//  Created by 汪子为 on 16/1/10.
//  Copyright © 2016年 zv. All rights reserved.
//

#import "ViewController.h"
#import "ZVScrollSlider.h"

@interface ViewController ()
{
    ZVScrollSlider *_productSlider;
}
@end

@implementation ViewController

- (ZVScrollSlider *)extracted:(CGFloat)sliderHeight title:(NSString *)title {
  
    
    //cell 个数   30天 * 24小时 + 2个cell 默认是当前时间
    int32_t maxValue =  2 * 24;
     ZVScrollSlider *zSlider = [[ZVScrollSlider alloc] initWithFrame:CGRectMake(0, 100, self.view.bounds.size.width, sliderHeight)
                                   Title:title
                                MinValue:0
                                MaxValue:maxValue
                                    Step:6
                                    Unit:@""
                            HasDeleteBtn:NO];
    
    return zSlider;
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    NSString *title = @"时间";
    CGFloat sliderHeight = [ZVScrollSlider heightWithBoundingWidth:self.view.bounds.size.width Title:title];
    _productSlider  = [self extracted:sliderHeight title:title];
    [self.view addSubview:_productSlider];

}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    [_productSlider startTimer];
}

- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];
    
    [_productSlider pauseTimer];
}

@end
// 版权属于原作者
// http://code4app.com (cn) http://code4app.net (en)
// 发布代码于最专业的源码分享网站: Code4App.com
